<template>
  <div class="body1" style="padding-top:10px;">
      <div class="form_select">
        <div>
          <el-input class="select_input" size="small" 
          v-model="form.keyword" placeholder="客户姓名"></el-input>
          <el-date-picker
            v-model="form.sdate"
            type="date"
            placeholder="预约开始日期" 
            size="small" 
            class="select_option1"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            >
          </el-date-picker>
          <el-date-picker
            v-model="form.edate"
            type="date"
            placeholder="预约结束日期" 
            size="small" 
            class="select_option1"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            >
          </el-date-picker>
          <el-select class="select_option" size="small" v-model="form.type" placeholder="完成状态">
            <el-option
              v-for="item in satausArr"
              :key="item.id"
              :label="item.name"
              :value="item.id">
            </el-option>
          </el-select>
          <el-button type="primary"  size="small" @click="getList">搜索</el-button>
        </div>
        <div class="select_right">
          <el-button type="primary"  size="small" @click="exportExcel">导出excel</el-button>
        </div>
      </div>
      <markTable :list="list" @func="dialogClose"></markTable>
  </div>
</template>
 
<script>
import markTable from "./markTable"
import {excelExport} from "../../public/excelExport"
export default {
  name: "Mark",
  data() {
    return {
      form:{},
      list:[],
      satausArr:[
        {id:0,name:'全部'},
        {id:1,name:'未完成'},
        {id:2,name:'已完成'},
        {id:3,name:'已取消'}
      ]
    };
  },
   components: {
    "markTable": markTable
  },
  created: function() {
    this.getList();
  },
  methods: {
    getList:function(){
        this.form.oa_id = localStorage.getItem('oa_id')
        var that = this
        this.$get('pc/mark/all',this.form).then((res) => {
          that.list = res.data
        })
    },
    dialogClose:function(data){
      if(data.type){
        this.getList()
      }
    },
    exportExcel:function() {
      let title = '预约时间表'
      excelExport(title)
      return false;
    }
  }
};
</script>
<style>
</style>